<div class="starter-template">
  <h1 translate lib="web">sockets</h1>
</div>

<input type="button" value="send one" ng-click="ctrl.SendOne()" class="btn btn-secondary"
  ng-disabled="ctrl.loading==true" translate lib="web" />
<input type="button" value="InsertMany" ng-click="ctrl.InsertMany()" class="btn btn-secondary"
  ng-disabled="ctrl.loading==true" translate lib="web" />
<input type="button" value="DeleteMany" ng-click="ctrl.DeleteMany()" class="btn btn-secondary"
  ng-disabled="ctrl.loading==true" translate lib="web" />
<div id="dvMessage" ng-model="ctrl.message"> </div>
<br />
<pre>{{ ctrl.messages }}</pre>



<table id="table1" class="table table-striped" when-scrolled="ctrl.more()" style="width: 100%;">
  <thead class="thead-dark">
    <tr>
      <th><b translate lib="web">createdby</b></th>
      <th><b translate lib="web">name</b></th>
      <th><b translate lib="web">created</b></th>
      <th><b translate lib="web">updated</b></th>
      <th></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat="model in ctrl.models">
      <td>{{model._createdby}}</td>
      <td>{{model.name}}</td>
      <td>
        <timesince ng-model="model._created" />
      </td>
      <td>
        <timesince ng-model="model._modified" />
      </td>
      <td class="btn-cell">
        <a href ng-click="ctrl.UpdateOne(model)" ng-disabled="ctrl.loading==true" translate lib="web">Update</a>
        <!-- <input type="button" value="Update" -->
      </td>
      <td class="btn-cell">
        <a href ng-click="ctrl.DeleteOne(model)" ng-disabled="ctrl.loading==true" translate lib="web">Delete</a>
        <!-- 
          <input type="button" value="Delete" ng-click="ctrl.DeleteOne(model)" ng-disabled="ctrl.loading==true" />
          -->
      </td>

    </tr>
  </tbody>
</table>